add support for load balancing across multiple models and providers#13
Open
uniAIDevs wants to merge 5 commits intomissingstudio:mainfrom
Open
add support for load balancing across multiple models and providers#13uniAIDevs wants to merge 5 commits intomissingstudio:mainfrom
uniAIDevs wants to merge 5 commits intomissingstudio:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces significant enhancements to the gateway's load balancing capabilities, focusing on ensuring that operations are only directed towards healthy providers. By integrating health checks across various points where providers and models are accessed or manipulated, we ensure higher reliability and availability in serving requests. This change affects how models and providers are listed, fetched, created, updated, and how their configurations are retrieved, ensuring that only healthy entities are interacted with. Code was created by Alex Scott and Sweep AI.
Summary
ListModels,ListProviders,GetProvider,CreateProvider,UpsertProvider, andGetProviderConfigmethods withingateway/internal/api/v1/models.goandproviders.goto ensure operations are performed only on healthy providers.DefaultHealthCheckerstruct ingateway/internal/router/health_checker.gothat currently assumes all providers are healthy. This serves as a placeholder for future, more sophisticated health check logic.PriorityRouterandRoundRobinRouteringateway/internal/router/priority.goandround_robin.goto select the next available healthy provider, enhancing the robustness of load balancing mechanisms.Files affected:
gateway/internal/api/v1/models.gogateway/internal/api/v1/providers.gogateway/internal/router/health_checker.gogateway/internal/router/priority.gogateway/internal/router/round_robin.go